package com.wejoy.video.middle.station.api.app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.util.IntrospectorCleanupListener;

/**
 * 工程启动配置
 *
 * @author admin
 */
@SpringBootApplication
@ComponentScan("com.wejoy.video.middle.station")
@EnableTransactionManagement
@EnableRedisHttpSession
@EnableCaching
public class ApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);
    }

    @Bean
    public ServletListenerRegistrationBean introspectorCleanupListener() {
        ServletListenerRegistrationBean listenerRegistration = new ServletListenerRegistrationBean();
        listenerRegistration.setListener(new IntrospectorCleanupListener());
        return listenerRegistration;
    }
}
